package com.socketeg.demo.config;

import com.socketeg.demo.socket.Server;
import lombok.extern.log4j.Log4j;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;


/**
 * 启动socketServer
 */
@Component
@Log4j
public class MyApplication implements ApplicationRunner {

    Logger logger = LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);

    @Override
    public void run(ApplicationArguments args) throws Exception {
        logger.info("socket server start");
        Server server = new Server();
        server.startServer();
    }
}
